package server;

import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
 * @author Y1n
 * @date 2021/11/19 16:36
 * @decs
 **/
public class LagouServlet extends HttpServlet{

    @Override
    public void doGet(Request request, Response response) {
        String  content = "<h1>LagouServlet get<h1>";
        try {
            response.output(HttpPortocolUtil.getHttpHeaderSuccess(content.getBytes(StandardCharsets.UTF_8).length)+content);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void doPost(Request request, Response response) {
        String  content = "<h1>LagouServlet post<h1>";
        try {
            response.output(HttpPortocolUtil.getHttpHeaderSuccess(content.getBytes(StandardCharsets.UTF_8).length)+content);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
